package ejercicio1;

import java.io.IOException;

import org.antlr.runtime.ANTLRFileStream;
import org.antlr.runtime.CommonTokenStream;
import org.antlr.runtime.Parser;
import org.antlr.runtime.RecognitionException;
import org.antlr.runtime.tree.Tree;
import org.antlr.runtime.tree.TreeAdaptor;

import antlr.collections.AST;
import antlr.debug.misc.ASTFrame;

public class Procesador {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Apéndice de método generado automáticamente
		try { 
			Explexer lex = new Explexer(new ANTLRFileStream(args[0]));
			CommonTokenStream tokens = new CommonTokenStream(lex);
			TreeAdaptor tree = null;
			ExpParser parser = new ExpParser(tokens);
			//parser.instrucciones();
			
			ExpParser.instrucciones_return result = parser.instrucciones();
			Tree t = (Tree)result.getTree();
			System.out.println(t.toStringTree());

			} catch (IOException e) {
			// TODO Bloque catch generado automáticamente
			e.printStackTrace();
		} catch (RecognitionException e) {
			// TODO Bloque catch generado automáticamente
			e.printStackTrace();
		}
		

	}

}
